package com.nondo.dean.order.mapper;

import com.nondo.dean.common.mybatis.Table;
import com.nondo.dean.order.domain.OrderStatus;
import com.nondo.dean.order.domain.OrderStatusExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

@Table("order_status")
@Mapper
public interface OrderStatusMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @SelectProvider(type=OrderStatusSqlProvider.class, method="countByExample")
    long countByExample(OrderStatusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @DeleteProvider(type=OrderStatusSqlProvider.class, method="deleteByExample")
    int deleteByExample(OrderStatusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @Delete({
        "delete from order_status",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @Insert({
        "insert into order_status (id, sale_code, ",
        "purchase_code, item_number, ",
        "user_name, product_name, ",
        "product_code, product_remark, ",
        "product_quantity, product_amount, ",
        "status, work_code, ",
        "work_create_date, work_plan_produce_date, ",
        "work_plan_complete_date, work_complete_date, ",
        "refuse_reason, send_date, ",
        "send_code, send_user, ",
        "new_work_procedure, create_by, ",
        "create_date, update_by, ",
        "update_date, remarks, ",
        "del_flag)",
        "values (#{id,jdbcType=INTEGER}, #{saleCode,jdbcType=VARCHAR}, ",
        "#{purchaseCode,jdbcType=VARCHAR}, #{itemNumber,jdbcType=VARCHAR}, ",
        "#{userName,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, ",
        "#{productCode,jdbcType=VARCHAR}, #{productRemark,jdbcType=VARCHAR}, ",
        "#{productQuantity,jdbcType=INTEGER}, #{productAmount,jdbcType=DECIMAL}, ",
        "#{status,jdbcType=INTEGER}, #{workCode,jdbcType=VARCHAR}, ",
        "#{workCreateDate,jdbcType=VARCHAR}, #{workPlanProduceDate,jdbcType=VARCHAR}, ",
        "#{workPlanCompleteDate,jdbcType=VARCHAR}, #{workCompleteDate,jdbcType=VARCHAR}, ",
        "#{refuseReason,jdbcType=VARCHAR}, #{sendDate,jdbcType=VARCHAR}, ",
        "#{sendCode,jdbcType=VARCHAR}, #{sendUser,jdbcType=VARCHAR}, ",
        "#{newWorkProcedure,jdbcType=VARCHAR}, #{createBy,jdbcType=BIGINT}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, ",
        "#{updateDate,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, ",
        "#{delFlag,jdbcType=CHAR})"
    })
    int insert(OrderStatus record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @InsertProvider(type=OrderStatusSqlProvider.class, method="insertSelective")
    int insertSelective(OrderStatus record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @SelectProvider(type=OrderStatusSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="sale_code", property="saleCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="purchase_code", property="purchaseCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="item_number", property="itemNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_remark", property="productRemark", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_quantity", property="productQuantity", jdbcType=JdbcType.INTEGER),
        @Result(column="product_amount", property="productAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="work_code", property="workCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_create_date", property="workCreateDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_plan_produce_date", property="workPlanProduceDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_plan_complete_date", property="workPlanCompleteDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_complete_date", property="workCompleteDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="refuse_reason", property="refuseReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_date", property="sendDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_code", property="sendCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_user", property="sendUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="new_work_procedure", property="newWorkProcedure", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<OrderStatus> selectByExampleWithRowbounds(OrderStatusExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @SelectProvider(type=OrderStatusSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="sale_code", property="saleCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="purchase_code", property="purchaseCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="item_number", property="itemNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_remark", property="productRemark", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_quantity", property="productQuantity", jdbcType=JdbcType.INTEGER),
        @Result(column="product_amount", property="productAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="work_code", property="workCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_create_date", property="workCreateDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_plan_produce_date", property="workPlanProduceDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_plan_complete_date", property="workPlanCompleteDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_complete_date", property="workCompleteDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="refuse_reason", property="refuseReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_date", property="sendDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_code", property="sendCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_user", property="sendUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="new_work_procedure", property="newWorkProcedure", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<OrderStatus> selectByExample(OrderStatusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @Select({
        "select",
        "id, sale_code, purchase_code, item_number, user_name, product_name, product_code, ",
        "product_remark, product_quantity, product_amount, status, work_code, work_create_date, ",
        "work_plan_produce_date, work_plan_complete_date, work_complete_date, refuse_reason, ",
        "send_date, send_code, send_user, new_work_procedure, create_by, create_date, ",
        "update_by, update_date, remarks, del_flag",
        "from order_status",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="sale_code", property="saleCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="purchase_code", property="purchaseCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="item_number", property="itemNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_remark", property="productRemark", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_quantity", property="productQuantity", jdbcType=JdbcType.INTEGER),
        @Result(column="product_amount", property="productAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="work_code", property="workCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_create_date", property="workCreateDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_plan_produce_date", property="workPlanProduceDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_plan_complete_date", property="workPlanCompleteDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="work_complete_date", property="workCompleteDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="refuse_reason", property="refuseReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_date", property="sendDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_code", property="sendCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_user", property="sendUser", jdbcType=JdbcType.VARCHAR),
        @Result(column="new_work_procedure", property="newWorkProcedure", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    OrderStatus selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @UpdateProvider(type=OrderStatusSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") OrderStatus record, @Param("example") OrderStatusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @UpdateProvider(type=OrderStatusSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") OrderStatus record, @Param("example") OrderStatusExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @UpdateProvider(type=OrderStatusSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(OrderStatus record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table order_status
     *
     * @mbg.generated Thu May 31 17:31:52 CST 2018
     */
    @Update({
        "update order_status",
        "set sale_code = #{saleCode,jdbcType=VARCHAR},",
          "purchase_code = #{purchaseCode,jdbcType=VARCHAR},",
          "item_number = #{itemNumber,jdbcType=VARCHAR},",
          "user_name = #{userName,jdbcType=VARCHAR},",
          "product_name = #{productName,jdbcType=VARCHAR},",
          "product_code = #{productCode,jdbcType=VARCHAR},",
          "product_remark = #{productRemark,jdbcType=VARCHAR},",
          "product_quantity = #{productQuantity,jdbcType=INTEGER},",
          "product_amount = #{productAmount,jdbcType=DECIMAL},",
          "status = #{status,jdbcType=INTEGER},",
          "work_code = #{workCode,jdbcType=VARCHAR},",
          "work_create_date = #{workCreateDate,jdbcType=VARCHAR},",
          "work_plan_produce_date = #{workPlanProduceDate,jdbcType=VARCHAR},",
          "work_plan_complete_date = #{workPlanCompleteDate,jdbcType=VARCHAR},",
          "work_complete_date = #{workCompleteDate,jdbcType=VARCHAR},",
          "refuse_reason = #{refuseReason,jdbcType=VARCHAR},",
          "send_date = #{sendDate,jdbcType=VARCHAR},",
          "send_code = #{sendCode,jdbcType=VARCHAR},",
          "send_user = #{sendUser,jdbcType=VARCHAR},",
          "new_work_procedure = #{newWorkProcedure,jdbcType=VARCHAR},",
          "create_by = #{createBy,jdbcType=BIGINT},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=BIGINT},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(OrderStatus record);
}